
CC=gcc
TARGET_NAME=libctest_log.so

SRCS += $(wildcard *.c)
OBJS = $(SRCS:.c=.o)

CFLAGS += -I./ctest_log/
LDFLAGS += -shared

$(info INFO:CC=${CC} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} OBJS=${OBJS})

.c.o:
	$(CC) -c $(CFLAGS) -o $@ $^

${TARGET_LIB_LOG}: 

${TARGET_NAME}: ${OBJS}
	# ${CC} ${LDFLAGS} -o $@ $^
	# cp -p $@ ../lib/
	ar -rc $(TARGET_NAME:.so=.a) $^
	cp -p $(TARGET_NAME:.so=.a) ../lib/
	# gcc -shared -o $@ $(TARGET_NAME:.so=.a)
	# cp -p $@ ../lib/

clean:
	rm -f ${OBJS}
	rm -f ${TARGET_NAME}
